<script type="text/javascript">
    
    function donothing()
    {
        alert("hello");
    }
    function ShowAction()
    {      
     
           $(".popUp").animate({
                      "top": "0"
                    }, "slow");
          
    }
    function closePopUp(){
           $(".popUp").animate({
              "top": "-300%"
            }, "slow");
            document.getElementById('input_counter').value = "";
            document.getElementById('input_purpose').value = "";
            document.getElementById('input_guest').value = "";
            document.getElementById('input_aff').value = "";
            $("div#status_loginEV").html("");
            window.location = "<?php echo base_url().'index.php/logbook/activity'?>";
    };
            
    function submitAct(){
        $.ajax({
                type: "POST",
                url: $("#logbook_submit").attr('action'),
                data: $("#logbook_submit").serialize(),
                dataType: 'json',
                success: function(json) {
                        if (json.status_submit) {
                                var res = json.status_submit.toString();
                                if(res == "oke"){
                                    $("div#status_submit").html("Sukses!");
                                    closePopUp();
                                    window.location = "<?php echo base_url().'index.php/logbook/activity'?>";
                                }
                                $("div#status_submit").html(res);
                        }
                        else alert("T.T");
                }
            });
            return false; 
    };
    
    function ajax_actResult()
    {
        $.ajax({
                type: "POST",
                url: $("#search").attr('action'),
                data: $("#search").serialize(),
                dataType: 'json',
                success: function(json) {
                        
                        if (json.renderhtml)
                        {
                           var res = json.renderhtml.toString();
                           $("div#ajax_result").html(res);
                        }
                        else
                        {
                           alert ("haduh");
                        }
                }
            });
            return false;
    }
</script>

<div class="addnew-tombol" onclick="ShowAction();">Add New Activity </div>
<div class="main">
    <div class="search-box1">
        <div id="search" method="post" action="<?php echo base_url().'index.php/logbook/showAllActivity' ?>">
            <input name="box_nama" type="text" title="Cari Aktifitas" class="text_input" id="activity" onchange="donothing()"/>
        </div>
    </div>
</div>

<div id="ajax_result" class="search_result">
   
</div>